﻿using System;
using System.Windows.Forms;
using ebc.message.contract;
using ebc.portal.contract;

namespace ebc.portal {
    public partial class GUI : Form , IPortal{
        public GUI() {
            InitializeComponent();
        }

        public void ShowResult(CoordinatorResult result) {
            resultDisplay.Text = string.Format("{0}=>InputResult Portal\t<=CoordinatorResult=>", result.FromTarget);
        }

        public event Action<CoordinatorRequest> OnCoordinator;

        private void RequestClick(object sender, EventArgs e) {
            var result = resultDisplay.Text + "=>OutputRequest Portal event OnCoordinator\t<=CoordinatorRequest=>" + Environment.NewLine;
            OnCoordinator( new CoordinatorRequest{FromSource = result});
        }
    }
}
